<?php 
class Admins extends Controller
{
	function Admins ()
	{
		parent::Controller();
		$this->load->library('layout', 'layouts/layout_admin');	
		$this->load->model('admins_model');
	}
	
	function index()
	{
		$this->verifyLogin('admin/admins/index');//revisar el parametro
		
		$data['admins'] = $this->admins_model->getEveryone();		 
		echo (" lasldfl kasd");
		
		$this->layout->view('admin/admins/index', $data);
	}
	
	function verifyLogin($action)
	{
		if (!$this->session->userdata('username')) {
			redirect("admin/login/index/".$action);
		}
	}
	
	function insert () 
	{
		$data['admins'] = $this->admins_model->getEveryone();
		$this->layout->view('adminuser/registeruser', $data);
	}
	
	function edit ()
	{
		$data['admins'] = $this->admins_model->getEveryone();
		$this->layout->view('adminuser/modifyuser', $data);
	}
	
	function delete ()
	{
		$data['admins'] = $this->admins_model->getEveryone();
		$this->layout->view('adminuser/deleteuser', $data);
	}
	
	function detail ()
	{
		$data['admins'] = $this->admins_model->getEveryone();
		$this->layout->view('adminuser/detailuser', $data);
	}
	
	function search()
	{
		//$this->verifyLogin('admin/admins/index');//revisar el parametro		
		$data['admins'] = $this->admins_model->getEveryone();		 
		$this->layout->view('adminuser/search', $data);
	}
	
}

?>
